home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CUCD / Programming / AMOSList / AMOSLIST / text0137.txt < prev    next >
Encoding:
Text File  |  1998-04-01  |  1.7 KB  |  63 lines

  1. Garfield Benjamin (gbenjam@sosbbs.com) wrote:
  2.  
  3. >> If AGE<10
  4. >>    Print "You are less than 10 years old."
  5. >> else if AGE=21
  6. >>    Print "Hey!! Now you can drink alcohol in the U.S.!!"
  7. >> else
  8. >>    Print "WOW, you're OVER 21!!"
  9. >> endif
  10. >> Smallest, and tidiest in my humble opinion.
  11. >> Is my approach good enough in the meantime?
  12.  
  13. >   Well, problem is this won't work. 
  14.  
  15. Yes it will. I tried it.
  16.  
  17. >First, you need to match every If with an End If and second, the logic is not 
  18. >the same.
  19.  
  20. Both. If and endif is coupled the same way as select ... case ... endselect
  21. is so I can't see the problem. The logic is the same too. Select..is just
  22. more advanced in that it offers some extra features.
  23.  
  24. >If AGE<10
  25. >   Print "You are less than 10 years old."
  26. >Else If AGE=21
  27. >      Print"Hey!! Now you can drink alcohol in the U.S.!!"
  28. >   Else If AGE>21
  29. >         Print "WOW, you'r OVER 21!!"
  30. >      End If
  31. >   End If
  32. >End If
  33.  
  34. That would trigger the error-system. One if and three end-ifs is plain
  35. wrong.
  36.  
  37. >   That being said, this might be a bit clearer (arguably the "best"
  38. >   method for AMOS) but it still lacks when compared to the
  39. >   Select...Case style.  Anyway, the point is you are still looking at
  40. >   the same two basic methods, the If...End If and the If...Else...EndIf
  41.  
  42. Yes but does it really matter? The result is what is importand and the
  43.  
  44. if...
  45.  
  46. else if ...
  47.  
  48. else
  49.  
  50. end if
  51.  
  52. structure is quite close to the select.. syntax.
  53.  
  54. ---
  55. Look at the shoes you're filling, look at the blood we're spilling
  56. Look at the world we're killing, the way we've always done before
  57. Look at the doubt we've wallowed, look at the leaders we've followed
  58. Look at the lies we've swallowed and I don't wanna hear no more
  59. ---
  60. Create the impression that you have already reached your level of incompetence.
  61.  
  62.  
  63.